<?php 
    defined('_JEXEC') or die('Restricted access');
    //print_r($this->list_employee);
?>

<script src="components/com_admin_employee/assets/js/tablesort.js" type="text/javascript"></script>


 <form action="index.php" method="post" id="login-form">
	<div class="login-greeting">
	Hi Super User,	</div>
	<div class="logout-button">
		<input type="submit" name="Submit" class="button" value="Log out" />
		<input type="hidden" name="option" value="com_users" />
		<input type="hidden" name="task" value="user.logout" />
		<input type="hidden" name="return" value="aW5kZXgucGhwP0l0ZW1pZD0xMDE=" />
		<input type="hidden" name="f0d939fe352d1ee4cac145366463a600" value="1" />	</div>
      <?php echo JHTML::_( 'form.token' ); ?>
</form>
<script type="text/javascript">
    function numbersonly(myfield, e, dec) {
  var key;
  var keychar;

  if (window.event)
    key = window.event.keyCode;
  else if (e)
    key = e.which;
  else
    return true;
  keychar = String.fromCharCode(key);

  // control keys
  if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )  //neu co key 13 thi se khong chan nut enter
    return true;

  // numbers
  else if ((("0123456789").indexOf(keychar) > -1))
    return true;

  // decimal point jump
  else if (dec && (keychar == ".")) {
    myfield.form.elements[dec].focus();
    return false;
  } else
    return false;
}

    function sub()
    {    
//        if(document.frmvp['name'].value=='')
//            {
//                alert('Bạn chưa nhập tên văn phòng.');
//                return 0;
//            }
//        if(document.frmvp['sonha'].value=='')
//            {
//                alert('Bạn chưa nhập số nhà.');
//                return;
//            }
//        if(document.frmvp['duong'].value=='')
//            {
//                alert('Bạn chưa nhập đường.');
//                return;
//            }  
//        if(document.frmvp['thanhpho'].value=='')
//            {
//                alert('Bạn chưa nhập thành phố.');
//                return;
//            } 
//        if(document.frmvp['dt1'].value=='')
//            {
//                alert('Văn phòng phải có ít nhất một số điện thoại.');
//                return;
//            }  
        var r=confirm("Xác nhận thêm ?");
        if (r==true)
          {
              document.frmvp.submit();
          }
        else
          {
          return;
          }
    }
</script>
<script type="text/javascript">
$(document).ready(function() {
	$('a.login-window').click(function() {
		
		// Getting the variable's value from a link 
		var loginBox = $(this).attr('href');

		//Fade in the Popup and add close button
		$(loginBox).fadeIn(300);
		
		//Set the center alignment padding + border
		var popMargTop = ($(loginBox).height() + 24) / 2; 
		var popMargLeft = ($(loginBox).width() + 24) / 2; 
		
		$(loginBox).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
		
		// Add the mask to body
		$('body').append('<div id="mask"></div>');
		$('#mask').fadeIn(300);
		
		return false;
	});
	
	// When clicking on the button close or the mask layer the popup closed
	$('a.close, #mask').live('click', function() { 
	  $('#mask , .login-popup').fadeOut(300 , function() {
		$('#mask').remove();  
	}); 
	return false;
	});
});
</script>
<style type="text/css">
.btn-sign {
	width:460px;
	margin-bottom:20px;
	margin:0 auto;
	padding:20px;
	border-radius:5px;
	background: -moz-linear-gradient(center top, #00c6ff, #018eb6);
    background: -webkit-gradient(linear, left top, left bottom, from(#00c6ff), to(#018eb6));
	background:  -o-linear-gradient(top, #00c6ff, #018eb6);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#00c6ff', EndColorStr='#018eb6');
	text-align:center;
	font-size:36px;
	color:#fff;
	text-transform:uppercase;
}

.btn-sign a { color:#fff; text-shadow:0 1px 2px #161616; }

#mask {
	display: none;
	background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

.login-popup{
        width: 500px;
	display:none;
	background: whitesmoke;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 50%; left: 50%;
	z-index: 99999;
	box-shadow: 0px 0px 20px #999;
	-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
    -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
	border-radius:3px 3px 3px 3px;
    -moz-border-radius: 3px; /* Firefox */
    -webkit-border-radius: 3px; /* Safari, Chrome */
}

img.btn_close {
	float: right; 
	margin: -28px -28px 0 0;
}

fieldset { 
	border:none; 
}

form.signin .textbox label { 
	display:block; 
	padding-bottom:7px; 
}

form.signin .textbox span { 
	display:block;
        float: left;
}

form.signin p, form.signin span { 
	color:black; 
	font-size:11px; 
	line-height:18px;
        font-family: arial;
} 

.cl { 
	background:#666666; 
	border-bottom:1px solid #333;
	border-left:1px solid #000;
	border-right:1px solid #333;
	border-top:1px solid #000;
	color:#fff; 
	border-radius: 3px 3px 3px 3px;
	-moz-border-radius: 3px;
    -webkit-border-radius: 3px;
	font:13px Arial, Helvetica, sans-serif;
	padding:6px 6px 4px;
	width:100%;
        float: left;
       
}

form.signin input:-moz-placeholder { color:#bbb; text-shadow:0 0 2px #000; }
form.signin input::-webkit-input-placeholder { color:#bbb; text-shadow:0 0 2px #000;  }

.button { 
	background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
	background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
	background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
	border-color:#000; 
	border-width:1px;
	border-radius:4px 4px 4px 4px;
	-moz-border-radius: 4px;
    -webkit-border-radius: 4px;
	color:#333;
	cursor:pointer;
	display:inline-block;
	padding:6px 6px 4px;
	margin-top:10px;
	font:12px; 
	width:214px;
}

.button:hover { background:#ddd; }

</style>
<link media="screen" rel="stylesheet" type="text/css" href="components/com_admin/assets/css/admin_style.css"  />
 
<div class="ad_menu">
						<?php include 'components/admin_menu.php';?>	
						
				<div class="ad_mid_title">
							<h2 class="ad_mid_title_content">Danh Sách Nhân Viên Đang Làm Việc
                                                            <a href="#login-box" class="login-window"><img src="components/com_admin/assets/images/add.png" style="height: 28px;width: 35px;float: right;"/></a>
                                                        <div id="login-box" class="login-popup">
        <a href="#" class="close"><img src="components/com_admin/assets/images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
        <fieldset class="textbox">
            <form method="post" class="signin" action="index.php?option=com_admin_employee" name="frmvp">
                <input type="hidden" name="task" value="add_em"/>
              <table width="100%">
  <tr>
      <td style="width: 25%"><span>Chọn Nhân Viên</span></td>
      <td >
          <select name="id_em" style="background: #666;
border-bottom: 1px solid #333;
border-left: 1px solid black;
border-right: 1px solid #333;
border-top: 1px solid black;
color: white;
border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font: 13px Arial, Helvetica, sans-serif;
padding: 6px 6px 4px;
width: 100%;">
              <?php 
                foreach($this->list_employee2 as $row)
                {
                    ?>
              <option value="<?php echo $row->id;?>"><?php echo $row->name;?></option>
                    <?php
                }
              ?>
          </select>
      </td>
  </tr>
  <tr>
      <td>
          <span>Địa Chỉ</span>
      </td>
      <td>
          <input type="text" name="address" class="cl"/>
      </td>
  </tr>
  <tr>
      <td>
          <span>Điện Thoại</span>
      </td>
      <td>
          <input type="text" name="phone" class="cl"/>
      </td>
  </tr>
  
  <tr>
      <td>
          <span>Số CMND</span>
      </td>
      <td>
          <input type="text" name="cmnd" class="cl"/>
      </td>
  </tr>
  <tr>
      <td>
          <span>Giới Tính</span>
      </td>
      <td>
          <input type="radio" name="sex" value="1" checked="check"><span>Nam</span>
        <input type="radio" name="sex" value="0"> <span>Nữ</span>
        
      </td>
  </tr>
  <tr>
      <td>
          <span>Ngày Sinh</span>
      </td>
      <td>
          <select name="day" class="cl" style="width: 33%;">
              <?php 
                for($i=1;$i<=31;$i++)
                {
                    ?>
              <option value="<?php echo $i;?>"><?php echo $i;?></option>    
                    <?php
                }
              ?>
          </select>
          <select name="month" class="cl" style="width: 33%;">
              <?php 
                for($i=1;$i<=12;$i++)
                {
                    ?>
              <option value="<?php echo $i;?>"><?php echo "Tháng ".$i;?></option>    
                    <?php
                }
              ?>
          </select>
          <select name="year" class="cl" style="width: 34%;">
              <?php 
                for($i=1900;$i<=2020;$i++)
                {
                    ?>
              <option value="<?php echo $i;?>"><?php echo $i;?></option>    
                    <?php
                }
              ?>
          </select>
      </td>
  </tr>
  
  
  
  <tr>
      <td>
          <span>Mô Tả Ngắn</span>
      </td>
      <td>
          <textarea name="cv"  style="background: #666;
border-bottom: 1px solid #333;
border-left: 1px solid black;
border-right: 1px solid #333;
border-top: 1px solid black;
color: white;
border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font: 13px Arial, Helvetica, sans-serif;
padding: 6px 6px 4px;
width: 100%;">
Nhập Mô Tả
                </textarea>
      </td>
  </tr>
  <tr>
      <td style="width: 25%"><span>Chọn Văn Phòng</span></td>
      <td >
          <select name="id_office" style="background: #666;
border-bottom: 1px solid #333;
border-left: 1px solid black;
border-right: 1px solid #333;
border-top: 1px solid black;
color: white;
border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font: 13px Arial, Helvetica, sans-serif;
padding: 6px 6px 4px;
width: 100%;">
              <?php 
                foreach($this->list_office as $row)
                {
                    ?>
              <option value="<?php echo $row->id;?>"><?php echo $row->name;?></option>
                    <?php
                }
              ?>
          </select>
      </td>
  </tr>
  <tr>
      <td style="width: 25%"><span>Chọn Chức Vụ</span></td>
      <td >
          <select name="id_fun" style="background: #666;
border-bottom: 1px solid #333;
border-left: 1px solid black;
border-right: 1px solid #333;
border-top: 1px solid black;
color: white;
border-radius: 3px 3px 3px 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font: 13px Arial, Helvetica, sans-serif;
padding: 6px 6px 4px;
width: 100%;">
              <?php 
                foreach($this->list_function as $row)
                {
                    ?>
              <option value="<?php echo $row->id;?>"><?php echo $row->name;?></option>
                    <?php
                }
              ?>
          </select>
      </td>
  </tr>
</table>
                <input type="button" class="submit button" onclick="sub()" value="Thêm"/>
                
                </form>              </fieldset>

                
          
		</div>
                                                        </h2>
                                                        
							<span class="ad_left_title"></span>
							<span class="ad_right_title"></span>
						</div>		                           
                                            <div>
							<!--[if !IE]>start section content top<![endif]-->
							<div class="ad_background_content">
								
											<div class="ad_background_content_2">
                                                                                            <!--[if !IE]>start dashboard menu<![endif]-->
                                                                                            
                                                                                            
                                                                                           
                                                                                            <table id="example1_table" width="100%" border="1">
                                                                                                <thead>
                                                                                                    <tr>
                                                                                                        <th>
                                                                                                            <a href="javascript:$('#example1_table').sortTable({onCol: 1, keepRelationships: true})">STT</a>
                                                                                                        </th>
                                                                                                        <th>
                                                                                                            <a href="javascript:$('#example1_table').sortTable({onCol: 2, keepRelationships: true})">Họ Tên</a>
                                                                                                        </th>
                                                                                                        <th>
                                                                                                            <a  href="javascript:$('#example1_table').sortTable({onCol: 3, keepRelationships: true})">Tên Đăng Nhập</a>
                                                                                                        </th>
                                                                                                        
                                                                                                        <th>
                                                                                                            <a  href="javascript:$('#example1_table').sortTable({onCol: 4, keepRelationships: true})">Làm Việc Tại</a>
                                                                                                        </th>
                                                                                                        <th>
                                                                                                            <a  href="javascript:$('#example1_table').sortTable({onCol: 5, keepRelationships: true})">Chức Vụ</a>
                                                                                                        </th>
                                                                                                        <th>
                                                                                                   Chi Tiết
                                                                                                </th>
                                                                                                 <th>
                                                                                                    Nghỉ Việc
                                                                                                </th>
                                                                                                    </tr>
                                                                                                </thead>
                                                                                                <tbody>
                                                                                                  
                                                                                                <?php 
                                                                                                    $i=1;
                                                                                                    foreach($this->list_employee as $row)
                                                                                                    {
                                                                                                        ?>
                                                                                                <tr>
                                                                                                    <td>
                                                                                                        <?php echo $i++; ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $row->name_us; ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $row->username;?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $row->name_br; ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $row->name_fu; ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <a href="index.php?option=com_admin_employee&view=info&id=<?php echo $row->id_user?>">Chi Tiết</a>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <a href="index.php?option=com_admin_employee&task=del&id=<?php echo $row->id_user; ?>">Nghỉ</a>
                                                                                                    </td>
                                                                                                </tr>                                                                                                       
                                                                                                            <?php
                                                                                                    }
                                                                                                ?>
                                                                                                </tbody>
                                                                                            </table>              
                                                                                                    
                                                                                                    
												
												<!--[if !IE]>end dashboard menu<![endif]-->
										
								</div>
							</div>
							<!--[if !IE]>end section content top<![endif]-->
							<!--[if !IE]>start section content bottom<![endif]-->
							<span class="scb"><span class="scb_left"></span><span class="scb_right"></span></span>
							<!--[if !IE]>end section content bottom<![endif]-->
							
						</div>
                                   
    <div class="ad_mid_title">
							<h2 class="ad_mid_title_content">Danh Sách Nhân Viên Chưa Làm Việc
                                                            <a href="index.php?option=com_adduserfrontend" ><img src="components/com_admin/assets/images/add.png" style="height: 28px;width: 35px;float: right;"/></a>
                                                        </h2>
                                                        
							<span class="ad_left_title"></span>
							<span class="ad_right_title"></span>
						</div>		                           
                                            <div>
							<!--[if !IE]>start section content top<![endif]-->
							<div class="ad_background_content">
								
											<div class="ad_background_content_2">
                                                                                            <!--[if !IE]>start dashboard menu<![endif]-->
                                                                                            
                                                                                            
                                                                                           
                                                                                            <table width="100%" border="1">
                                                                                                <thead>
                                                                                                <th>
                                                                                                    STT
                                                                                                </th>
                                                                                                <th>
                                                                                                    Họ Tên
                                                                                                </th>
                                                                                                
                                                                                                </thead>     
                                                                                                <?php 
                                                                                                    $i=1;
                                                                                                    foreach($this->list_employee2 as $row)
                                                                                                    {
                                                                                                        ?>
                                                                                                <tr>
                                                                                                    <td>
                                                                                                        <?php echo $i++; ?>
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <?php echo $row->name; ?>
                                                                                                    </td>
                                                                                                    
                                                                                                </tr>                                                                                                       
                                                                                                            <?php
                                                                                                    }
                                                                                                ?>
                                                                                            </table>              
                                                                                                    
                                                                                                    
												
												<!--[if !IE]>end dashboard menu<![endif]-->
										
								</div>
							</div>
							<!--[if !IE]>end section content top<![endif]-->
							<!--[if !IE]>start section content bottom<![endif]-->
							<span class="scb"><span class="scb_left"></span><span class="scb_right"></span></span>
							<!--[if !IE]>end section content bottom<![endif]-->
							
						</div>
                                             
					</div>



